/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ownPackage;

/**
 *
 * @author FERMYTH
 */
import java.io.*;
import javax.swing.JTextArea;
class StreamGobbler extends Thread
{
    InputStream is;
    String type;
    JTextArea Logs;

    StreamGobbler(InputStream is, String type, JTextArea Logs)
    {
        this.is = is;
        this.type = type;
        this.Logs = Logs;
    }

    public void run()
    {
        try
        {
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);
            String line=null;
            while ( (line = br.readLine()) != null)
                System.out.println(type + ">" + line);
            Logs.append("grobber - out \n");
            } catch (IOException ioe)
              {
                ioe.printStackTrace();
              }
    }
}
